Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Defining an IF-THEN-ELSE decision point
You’ll notice when you run your procedure that some of the ship dates aren’t defined. Some of these Orders apparently have been on hold for a very long time! Let’s construct a statement to branch in the code depending on whether the ShipDate field is defined or not. The 4GL, like most languages, has an
IF-THENconstruct for such decision points. It can also have anELSEbranch:
The
conditionis any expression that evaluates to true or false. Following theTHENkeyword, you can place a single 4GL statement or a whole set of statements that are all to be executed if the condition is true. The way to represent a block that simply groups a series of statements together that are all executed together is aDO-ENDblock:
If you include the
ELSEkeyword followed by a statement or a block of statements, that branch is taken if theconditionevaluates to false.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |